require 'encoder'

module PCLink 

CLIENT_HELLO=<<CLIENT_HELLO
<PCLinkClient>
  <Version>1.0</Version>
  <Name>MC-i200</Name>
  <VendorID>Philips</VendorID>
  <IP>encoded_ip</IP>
  <Port>encoded_port</Port>
</PCLinkClient>
CLIENT_HELLO

  class MessageFactory
    def create_hello_message(ipaddr, port)
      encoder = Encoder.new
      msg = CLIENT_HELLO
      msg = msg.gsub(/encoded_ip/, encoder.encode_ip(ipaddr).to_s)
      msg = msg.gsub(/encoded_port/, encoder.encode_short(port).to_s)
    end
  end
end
